/**
 * Author:yuiop
 * Date:2022/6/22 08:54
 */
package com.devops.admin.util;

import cn.hutool.core.io.IORuntimeException;
import cn.hutool.http.HttpUtil;

public class HelmWrapperUtil {
    public static void checkHelmWrapperServiceUrl(String helmWrapperServiceUrl) {
        Assert.isTrue(HttpCheckUtil.isURL(helmWrapperServiceUrl),"HelmWrapperUrl格式不合法");
        //HelmWrapperUrl是否可访问校验
        String result = "";
        try {
            result = HttpUtil.get(helmWrapperServiceUrl,6000);
        } catch (IORuntimeException e) {
            e.printStackTrace();
        } finally {
            Assert.isTrue(result.equals("Welcome helm wrapper server"),"HelmWrapper服务不可用，请联系管理员！");
        }
    }
}
